package cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo;

import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseengineeringdetail.PurchaseEngineeringDetailSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseequipmentdetail.PurchaseEquipmentDetailSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchasematerialdetail.PurchaseMaterialDetailSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseminordetail.PurchaseMinorDetailSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseplan.vo.purchaseservicedetail.PurchaseServiceDetailSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 采购计划新增/修改 Request VO")
@Data
public class PurchasePlanSaveReqVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11924")
    private Long id;

    @Schema(description = "采购计划名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
    @NotEmpty(message = "采购计划名称不能为空")
    private String planName;

    @Schema(description = "采购计划编号(系统自动生成)")
    private String planNo;

    @Schema(description = "采购类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "SERVICE/EQUIPMENT/ENGINEERING/MATERIAL/DIRECT/MINOR")
    @NotEmpty(message = "采购类型不能为空")
    private String purchaseType;

    @Schema(description = "预算归属部门ID", example = "9338")
    private Long budgetDepartmentId;

    @Schema(description = "预算归属部门名称", example = "赵六")
    private String budgetDepartmentName;

    @Schema(description = "需求申请部门ID", example = "30026")
    private Long applicationDepartmentId;

    @Schema(description = "需求申请部门名称", example = "王五")
    private String applicationDepartmentName;

    @Schema(description = "需求申请人ID", example = "25967")
    private Long applicantId;

    @Schema(description = "需求申请人姓名", example = "张三")
    private String applicantName;

    @Schema(description = "采购方式")
    private String purchaseMethod;

    @Schema(description = "项目名称")
    private String projectName;

    @Schema(description = "质保期/维保期")
    private String warrantyPeriod;

    @Schema(description = "原合同期限开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime originalContractStartTime;

    @Schema(description = "原合同期限结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime originalContractEndTime;

    @Schema(description = "原合同金额(万元)")
    private BigDecimal originalContractAmount;

    @Schema(description = "合同履约情况")
    private String contractPerformance;

    @Schema(description = "本次采购预估单价来源说明")
    private String estimatedPriceSource;

    @Schema(description = "需到货时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime requiredDeliveryTime;

    @Schema(description = "施工时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime constructionTime;

    @Schema(description = "施工工期开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime constructionStartTime;

    @Schema(description = "施工工期结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime constructionEndTime;

    @Schema(description = "施工期间负责人")
    private String constructionLeader;

    @Schema(description = "是否含有非标配件(0-否 1-是)")
    private Boolean hasNonStandardParts;

    @Schema(description = "是否含暂列金(0-否 1-是)")
    private Boolean hasProvisionalSum;

    @Schema(description = "实施小组组成及分工")
    private String implementationTeam;

    @Schema(description = "谈判报价方式")
    private String negotiationMethod;

    @Schema(description = "供应商选择原则")
    private String supplierSelectionPrinciple;

    @Schema(description = "项目理由及必要性说明", example = "项目理由及必要性说明")
    private String projectReason;

    @Schema(description = "备注说明", example = "备注说明")
    private String remark;

    @Schema(description = "采购申请开始时间")
    private LocalDateTime applicationStartTime;

    @Schema(description = "采购申请结束时间")
    private LocalDateTime applicationEndTime;

    @Schema(description = "只有是服务类采购时才是必填")
    private List<PurchaseServiceDetailSaveReqVO> serviceDetailSaveReqVOS;

    @Schema(description = "只有是小额采购时才是必填")
    private List<PurchaseMinorDetailSaveReqVO> minorDetailSaveReqVOS;

    @Schema(description = "只有是物料采购时才是必填")
    private List<PurchaseMaterialDetailSaveReqVO> materialDetailSaveReqVOS;

    @Schema(description = "只有是设备采购时才是必填")
    private List<PurchaseEquipmentDetailSaveReqVO> equipmentDetailSaveReqVOS;

    @Schema(description = "只有是工程采购时才是必填")
    private List<PurchaseEngineeringDetailSaveReqVO> engineeringDetailSaveReqVOS;
}